def sum(n,flor):
    sums = 0
    for i in n:
        if isinstance(i, list):
            sums += sum(i,flor+1)
        if isinstance(i, int):
            sums += i*flor
        if isinstance(i, float):
            sums += i*flor
    return sums
a = eval(input())
print(sum(a,1))